package com.lzq.springioc.beanconfig;


import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class BeanConfig {
    @Bean(name = {"u1","u2"})
    public User user1(){
        User user = new User();
        user.setName("zhangsan");
        user.setAge(22);
        return user;
    }
    @Bean
    public User user2(){
        User user = new User();
        user.setName("lisi");
        user.setAge(19);
        return user;
    }
}
